<?php
// ----------------------------------------------------------
// Haut de la page ------------------------------------------
$haut = haut;
if(!file_exists("./" . $haut . ".php"))
die("<h1>Forbidden</h1>");
include("./" . $haut . ".php");
// ----------------------------------------------------------
// Texte principale -----------------------------------------
?>

<div class="article">
	<h1>Galerie photo</h1>
	<?php
	if (isset($_SESSION['pseudo']))
		{
		$reponse = mysql_query("SELECT * FROM photos ORDER BY protection DESC"); // Requete SQL
		}
		else
		{
		$reponse = mysql_query("SELECT * FROM photos WHERE protection='0'"); // Requete SQL
		}
	// On fait une boucle pour lister tout ce que contient la table :
	$i=1;
	while ($donnees = mysql_fetch_array($reponse))
		{
		?>
		<a href="<?php echo $donnees["photo"]; ?>"  rel="lightbox[images]" >
		<img src="<?php echo $donnees["photo"]; ?>" alt="<?php echo $donnees["nom"]; ?>" title="<?php echo $donnees["nom"]; ?>" width="100" height="100" ></a>
		<?php
		if($i>=5)
			{
			$i=1;
			echo '<div class="clear"></div>';
			}
			else
			{
			$i++;
			}
		}
	?>
	
	<div class="clear"></div>
</div>

<?php		
// ----------------------------------------------------------
// Bas de la page -------------------------------------------
$bas = bas;
if(!file_exists("./" . $bas . ".php"))
die("<h1>Forbidden</h1>");
include("./" . $bas . ".php");
// ----------------------------------------------------------
?>	